package com.video.video.service.impl;

import com.video.common.utils.uuid.IdUtils;
import java.util.List;
import com.video.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.video.video.mapper.DCompanyMapper;
import com.video.video.domain.DCompany;
import com.video.video.service.IDCompanyService;

/**
 * 联系我们Service业务层处理
 *
 * @author ruoyi
 * @date 2022-10-05
 */
@Service
public class DCompanyServiceImpl implements IDCompanyService
{
    @Autowired
    private DCompanyMapper dCompanyMapper;

    /**
     * 查询联系我们
     *
     * @param id 联系我们主键
     * @return 联系我们
     */
    @Override
    public DCompany selectDCompanyById(String id)
    {
        return dCompanyMapper.selectDCompanyById(id);
    }

    /**
     * 查询联系我们列表
     *
     * @param dCompany 联系我们
     * @return 联系我们
     */
    @Override
    public List<DCompany> selectDCompanyList(DCompany dCompany)
    {
        return dCompanyMapper.selectDCompanyList(dCompany);
    }

    /**
     * 新增联系我们
     *
     * @param dCompany 联系我们
     * @return 结果
     */
    @Override
    public int insertDCompany(DCompany dCompany)
    {
        dCompany.setId(IdUtils.getId());
        dCompany.setCreateTime(DateUtils.getNowDate());
        return dCompanyMapper.insertDCompany(dCompany);
    }

    /**
     * 修改联系我们
     *
     * @param dCompany 联系我们
     * @return 结果
     */
    @Override
    public int updateDCompany(DCompany dCompany)
    {
        dCompany.setUpdateTime(DateUtils.getNowDate());
        return dCompanyMapper.updateDCompany(dCompany);
    }

    /**
     * 批量删除联系我们
     *
     * @param ids 需要删除的联系我们主键
     * @return 结果
     */
    @Override
    public int deleteDCompanyByIds(String[] ids)
    {
        return dCompanyMapper.deleteDCompanyByIds(ids);
    }

    /**
     * 删除联系我们信息
     *
     * @param id 联系我们主键
     * @return 结果
     */
    @Override
    public int deleteDCompanyById(String id)
    {
        return dCompanyMapper.deleteDCompanyById(id);
    }
}
